<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>会员登录 - {muy:siteseo name='title'}</title>
    <link href="__INDEXST__user/static/css/dgy.base.css" rel="stylesheet" type="text/css">
    <link href="__INDEXST__user/static/css/dgy.login.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__INDEXST__user/static/js/jquery-2.1.4.min.js"></script>
    <script type="text/javascript" src="__INDEXST__user/static/layer/layer.js"></script>
    <link rel="stylesheet" href="__INDEXST__user/static/layer/theme/default/layer.css?v=3.1.1" id="layuicss-layer">
  </head>
  <body>
    <div class="dogo_loginwp">
            <a class="dogo_logo" href="/" target="_blank">
                <img src="{muy:siteseo name='logo'}" class="logo">
            </a>
	      <div class="midgroup">
	           <div class="loginwrap loginwarrp">
                    <div class="logingroup login_form">
            			<form action="/" method="post" onsubmit="return checkall(this)">
            				
                            <section>
                            	<input type="text" placeholder="请输入用户名或邮箱" class="input_block login_account" name="account" id="account" value="{$Think.session.username}">
                            </section>
                            <section>
                            	<input type="password" placeholder="请输入密码" class="input_block login_account" name="password" id="password" value="">
                            </section>
                            {if !empty($Think.session.userpwd_error)}
                            <section class="qrcode" id="yzm">
                            	<input type="text" placeholder="请输入验证码" class="input_block login_code" required="" name="verif" id="captcha">
                            	<img id="verif_img" src="{:captcha_src()}" onclick="this.src=this.src+'?'+Math.random()" class="qrcode verifyimg" title="看不清，换一张">
                            </section>
                            {/if}
                            <input type="submit" class="loginbtn" id="dosubmit" name="dosubmit" value="立即登录">
                            <section style="background:none; margin-top:10px; border:0;">
                                还没有会员，<a href="{:url('index/Index/reg')}" style="color:#409eff;">立即注册</a>
                                <a href="{:url('index/Index/password')}" style="float:right;">忘记密码？</a>
                                <div class="clearfix"></div>
                            </section>
                        </form>
                        <footer style="text-align:center;">
						    <p>一个简洁、轻量、实用的内容管理系统！</p>
                        </footer>
                    </div>
	           </div>
	      </div>
	</div>
	
    <div class="footerInfo">
        <p>Copyright ©2020 <a href="/" target="_blank">{muy:siteseo name='title'}</a> All Rights Reserved.</p>
    </div>
    
  <script type="text/javascript">
      function checkall(obj) {
			 var username=$("#account").val();
			if( username== ''){
				layer.msg('用户名不能为空！', {icon:2,time: 1000});
				$("#account").focus();
				return false;
			}
			if(username.length < 6){
				    layer.msg('用户名低于6位！', {icon:2,time: 1000});
				    $("#account").focus();
				return false;
				}
				var captcha=$("#captcha").val();
            if( captcha== ''){
				layer.msg('验证码不能为空！', {icon:2,time: 1000});
				$("#captcha").focus();
				return false;
			}
			var password = $("#password").val();
			if(password.length < 6 ){
				layer.msg('密码不能低于6位！', {icon:2,time: 1000});
				$("#password").focus();
				return false;
			}
		
			//$e=$("#email_code").val();
            //console.log($e);
			var dosubmit = false;
			$.ajax({   
				type: "post",   
				url: "{:url('Index/checklogin')}",   
				dataType: "json",
				async: false,
				data:  $(obj).serialize(),
				success: function(msg){  
					if(msg.code == 1){
						layer.msg(msg.msg, {icon:1,time: 3000}, function() {
							if(msg.url) location.href = msg.url;
							});
					}else{
						if(msg.code == 0){
						    layer.msg(msg.msg, {icon:2,time: 2000},function(){
						        location.reload();
						    });
						    //$("#yzm").show();
							//$('#captcha+img').attr('src',$('#captcha+img').attr('src') + '?' + Math.random());
							//$("#captcha").focus();
						}
						
					}				 
				} 
			});
			return dosubmit ? true : false;
		}
      
  </script>
</body></html>